# Reference: <https://postmarketos.org/devicepkg>
pkgname=device-samsung-starqltechn
pkgdesc="Samsung Galaxy S9 SM-G9600"
pkgver=7
pkgrel=1
url="https://postmarketos.org"
license="MIT"
arch="aarch64"
options="!check !archcheck"
depends="
	postmarketos-base
	linux-postmarketos-qcom-sdm845
	mkbootimg
	u-boot-starqltechn
	u-boot-tools
	dtc
	firmware-samsung-sdm845
	soc-qcom-sdm845-nonfree-firmware
	soc-qcom-sdm845-modem
	"
makedepends="devicepkg-dev dtc"
source="deviceinfo boot_image.its payload_mock.dts bootscript.sh"

build() {
	devicepkg_build $startdir $pkgname
}

package() {
	devicepkg_package $startdir $pkgname
	mkdir -p "$pkgdir"/usr/share/u-boot/starqltechn/
	mkdir "$builddir"
	payload_mock_dtb="$builddir/payload_mock.dtb"
	dtc -I dts -O dtb -o "$payload_mock_dtb" "$srcdir/payload_mock.dts"
	install -D -m644 "$payload_mock_dtb" \
		"$pkgdir"/usr/share/u-boot/starqltechn/payload_mock.dtb
	install -D -m644 "$srcdir/"*.its \
		"$pkgdir"/usr/share/u-boot/starqltechn/
	install -D -m644 "$srcdir/"bootscript.sh \
		"$pkgdir"/usr/share/u-boot/starqltechn/
}


sha512sums="
3e156438c0630f830bcde96e13a003a15e399f5bd610707a099aa8d936e1bafb4a92560b4e69a3ebff8371c3f35bce502a34f5ee6221cbbcd6d96f9c20a258b3  deviceinfo
3047ff60cb25564bec0637030917981653a5a85024b221d58f510585e5b2102dc806f4970976fef0854ea3d5803ea0b545e9b2b5b1045a9868aba2e7eff7f7c1  boot_image.its
ba782c324c14cf0947c752b51a607ae1b08def885b0cf0afe89d1fcade3491ab2f547551eb08bd8074f608dac46bdcdf75c5c633bd7a15e6eb63a10f30994c82  payload_mock.dts
1ae956562df26c458654c178efcba4862ff9a8b55d5f27bb74f1667bb2434f4bf95ec4f3ffc54d7bc84a6d075e9caadf46716dd72bc9d6b7b623ec4f25940f36  bootscript.sh
"
